//对比post和get两种请求方式
const express = require('express');
var app = express();
var server = app.listen(3000,(req,res)=>{
  console.log('服务器启动成功...');
});
//如果访问的url /login，就把login.html发送给客户端
app.get('/login',(req,res)=>{
  res.sendFile(__dirname+'/static/login.html');
});
app.get('/member',(req,res)=>{
  res.send('this is member page');
});
app.post('/admin',(req,res)=>{
  res.send('this is admin page');
  //获取数据
  req.on('data',(data)=>{
    console.log(data.toString());
  });
});